package ${basePackage}.cli;

import ${basePackage}.cli.command.ConfigCommand;
import ${basePackage}.cli.command.GenerateCommand;
import ${basePackage}.cli.command.ListCommand;
import picocli.CommandLine;
import picocli.CommandLine.Command;

/**
 * @author ${author}
 * @version ${version}
 * @description 主执行器
 * @date 2024/7/24 12:53
 */
@Command(name = "${name}",mixinStandardHelpOptions = true)
public class CommandExecutor implements Runnable {



    private final CommandLine commandLine;

    {
        commandLine = new CommandLine(this)
                .addSubcommand(new ConfigCommand())
                .addSubcommand(new GenerateCommand())
                .addSubcommand(new ListCommand());
    }


    @Override
    public void run() {
        //不输出子命令
        System.out.println("请输出具体命令,或者输出--help 查看命令提示");
    }


    public Integer doExecute(String[] args){
        return commandLine.execute(args);
    }
}
